#ifndef CONSULTANT_FORM_H
#define CONSULTANT_FORM_H

#include <Qt\qdialog.h>
#include <Qt\qlabel.h>
#include <Qt\qlineedit.h>
#include <Qt\qboxlayout.h>
#include <Qt\qpushbutton.h>
#include <Qt\qcolor.h>
#include <Qt\qpalette.h>
#include <Qt\qregexp.h>
#include <Qt\qcheckbox.h>

#include "Consultant.h"

class PropertiesDialog;

class ConsultantForm : public QDialog{
	Q_OBJECT
public :
	static const int MODE_ADD;
	static const int MODE_MODIFY;
	
	static const int SEPARATOR_STRETCH_FACTOR;
	static const int LABEL_STRETCH_FACTOR;
	static const int FIELD_STRETCH_FACTOR;

private :
	QBoxLayout* layout;

	QLabel* firstNameLabel;
	QLabel* nameLabel;
	QLabel* mailLabel;
	QLabel* accorLabel;
	QLabel* smokerLabel;

	QLineEdit* firstName;
	QLineEdit* name;
	QLineEdit* mail;
	QLineEdit* accor;
	QCheckBox* smoker;
	
	QPushButton* okButton;
	QPushButton* cancelButton;

	Consultant* consultant;
	int mode;
	
	ConsultantForm(const ConsultantForm&) {}
	bool verifyFields(void);

public :
	ConsultantForm(PropertiesDialog* _parent, Consultant* _consultant = 0);

	Consultant* getConsultant(void) const { return consultant; }
	int getMode(void) const { return mode; }

public slots :
	void validate(void);
	void cancel(void);
};

#endif //CONSULTANT_FORM_H